#include <vector>

using namespace std;

/* 计数排序 */
// 简单实现，无法用于排序对象
void countingSortNaive(vector<int>& nums) {
    int m = 0;
    for (int num : nums) {
        m = max(m, num);
    }
    vector<int> counter(m + 1, 0);
    for (int num : nums) {
        counter[num]++;
    }
    int i = 0;
    for (int num = 0; num < m + 1; num++) {
        for (int j = 0; j < counter[num]; j++, i++) {
            nums[i] = num;
        }
    }
}
